package com.hebxy.ssm.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hebxy.ssm.dao.UserMapper;
import com.hebxy.ssm.entity.User;
import com.hebxy.ssm.service.UserService;

@Service
public class UserServiceImpl implements UserService {

	@Autowired
	private UserMapper userMapper;
	@Override
	public User findForlogin(Map<String, Object> map) {
		return userMapper.login(map);
	}

	@Override
	public User findByCardNumber(String card_number) {
		
		return userMapper.selectByCardNumber(card_number);
	}

	@Override
	public int addUser(User user) {
		
		return userMapper.insertUser(user);
	}

	@Override
	public List<User> findUserList() {
		
		return userMapper.selectUserList();
	}

	@Override
	public void deleteUserById(Integer id) {
		userMapper.deleteUserById(id);
		
	}

	@Override
	public User findUserById(Integer id) {
		// TODO Auto-generated method stub
		return userMapper.selectById(id);
	}

	@Override
	public int updateUser(User user) {
		
		return userMapper.updateUser(user);
	}

	@Override
	public void deleteUserByIds(Map<String, Object> map) {
		userMapper.deleteByIds(map);
		
	}

	@Override
	public void updateUserPlan(User user) {
		userMapper.updateUserPlan(user);
		
	}
	

}
